home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / rtgmaster_dev / includes / sasc / rtgmaster / rtgsublibs.h < prev    next >
C/C++ Source or Header  |  1998-08-13  |  16KB  |  515 lines

  1. /*
  2. **     $VER: rtgsublibs.h 1.008 (29 Jul 1997)
  3. */
  4.  
  5. #ifndef RTGSUBLIBS_H
  6. #define RTGSUBLIBS_H TRUE
  7.  
  8. #ifndef UTILITY_TAGITEM_H
  9. #include "utility/tagitem.h"
  10. #endif
  11.  
  12. #ifndef EXEC_TYPES_H
  13. #include "exec/types.h"
  14. #endif
  15.  
  16. #ifndef EXEC_NODES_H
  17. #include "exec/nodes.h"
  18. #endif
  19.  
  20. // The TagItem ID's (ti_Tag values) for OpenRtgScreen()
  21.  
  22. // Information like width, height, screenmode to use, depth and overscan
  23. // information is located in the ScreenReq structure which must be passed
  24. // to OpenRtgScreen().  The RtgScreenModeReq() function creates these
  25. // ScreenReq structures for you.
  26.  
  27. #define rtg_Dummy TAG_USER
  28.  
  29. #define rtg_Buffers (rtg_Dummy + 0x01)
  30.  
  31. // [1] You can use this tag to specify the number
  32. // of screen buffers for your screen.  Setting this
  33. // to 2 or 3 will allow you to do Double or Triple
  34. // buffering.  Valid values are 1, 2 or 3.
  35.  
  36. #define rtg_Interleaved (rtg_Dummy + 0x02)
  37.  
  38. // [FALSE] Specifying TRUE will cause bitmaps to
  39. // be allocated interleaved.  OpenRtgScreen will
  40. // fail if bitplanes cannot be allocated that way
  41. // unlike Intuition/OpenScreenTagList().
  42.  
  43. #define rtg_Draggable (rtg_Dummy + 0x03)
  44.  
  45. // [TRUE] Specifying FALSE will make the screen
  46. // non-draggable.  Do not use without good reason!
  47.  
  48. #define rtg_Exclusive (rtg_Dummy + 0x04)
  49.  
  50. // [FALSE] Allows screens which won't share the
  51. // display with other screens.  Use sparingly!
  52.  
  53. // #define rtg_ChunkySupport (rtg_Dummy + 0x05)
  54. //
  55. // [0] This LONG is used to indicate which
  56. // Chunky modes this application supports.  A
  57. // set bit means the mode is supported:
  58.  
  59. // ;    ;
  60. // ;    ;    | Pixels  | Pixel|Color| Pixel
  61. // ;    ; Bit|represent| size |space| layout
  62. // ;    ;------------------------------------------------------------------
  63. // ;    ;  0  TrueColor  LONG   RGB   %00000000 rrrrrrrr gggggggg bbbbbbbb  ARGB32
  64. // ;    ;  1  TrueColor 3 BYTE  RGB   %rrrrrrrr gggggggg bbbbbbbb           RGB24
  65. // ;    ;  2  TrueColor  WORD   RGB   %rrrrrggg gggbbbbb                    RGB16
  66. // ;    ;  3  TrueColor  WORD   RGB   %0rrrrrgg gggbbbbb                    RGB15
  67. // ;    ;  4  TrueColor  LONG   BGR   %00000000 bbbbbbbb gggggggg rrrrrrrr  ABGR32
  68. // ;    ;  5  TrueColor 3 BYTE  BGR   %bbbbbbbb gggggggg rrrrrrrr           BGR24
  69. // ;    ;  6  TrueColor  WORD   BGR   %bbbbbggg gggrrrrr                    BGR16
  70. // ;    ;  7  TrueColor  WORD   BGR   %0bbbbbgg gggrrrrr                    BGR15
  71. // ;    ;  8  TrueColor  LONG   RGB   %rrrrrrrr gggggggg bbbbbbbb 00000000  RGBA32
  72. // ;    ;  9  ColorMap   BYTE   -     -                                     LUT8
  73. // ;    ; 10  Graffiti   BYTE   -     - (Graffiti style chunky, very special)
  74. // ;    ; 11  TrueColor  WORD   RGB   %gggbbbbb 0rrrrrgg                    RGB15PC
  75. // ;    ; 12  TrueColor  WORD   BGR   %gggrrrrr 0bbbbbgg                    BGR15PC
  76. // ;    ; 13  TrueColor  WORD   RGB   %gggbbbbb rrrrrggg                    RGB16PC
  77. // ;    ; 14  TrueColor  WORD   BGR   %gggrrrrr bbbbbggg                    BGR16PC
  78. // ;    ; 15  TrueColor  LONG   BGR   %bbbbbbbb gggggggg rrrrrrrr 00000000  BGRA32
  79. //;
  80. //    ; This table is by no means complete.  There are probably more modes
  81. //    ; available on common Amiga graphic cards, but I have no information
  82. //    ; on them yet.  If you know about such modes please contact me.
  83. //
  84. //    ; Setting this LONG to zero means your application doesn't support
  85. //    ; any Chunky orientated display modes.
  86. //
  87. //    #define rtg_PlanarSupport (rtg_Dummy + 0x06)
  88. //                            ;[0] This LONG is used to indicate which
  89. //                            ;Planar modes this application supports.  A
  90. //                            ;set bit means the mode is supported:
  91. //    ; Bit 0: Indicates it supports 1 bitplane non-interleaved
  92. //    ; Bit 1: Indicates it supports 2 bitplanes non-interleaved
  93. //    ; (...)
  94. //    ; Bit 7: Indicates it supports 8 bitplanes non-interleaved
  95. //
  96. //    ; Bit 16: Indicates it supports 1 bitplane interleaved
  97. //    ; Bit 17: Indicates it supports 2 bitplanes interleaved
  98. //    ; (...)
  99. //    ; Bit 23: Indicates it supports 8 bitplanes interleaved
  100. //
  101. //    ; Bit 15: Indicates it supports EHB mode (6 bitplanes) non-interleaved
  102. //    ; Bit 31: Indicates it supports EHB mode (6 bitplanes) interleaved
  103. //
  104. //    ; Note that all planar modes are color-mapped.  Bits 8-14 and 24-30
  105. //    ; are unused for now, but could be used later to support planar modes
  106. //    ; with even higher number of bitplanes.
  107. //
  108. //    ; Setting this LONG to zero means your application doesn't support
  109. //    ; any Planar orientated display modes.
  110.  
  111.  
  112. #define ARGB32 1L
  113. #define RGB24  2L
  114. #define RGB16  4L
  115. #define RGB15  8L
  116. #define ABGR32 16L
  117. #define BGR24  32L
  118. #define BGR16  64L
  119. #define BGR15  128L
  120. #define RGBA32 256L
  121. #define LUT8   512L
  122. #define GRAFFITI 1024L
  123. #define RGB15PC  2048L
  124. #define BGR15PC  4096L
  125. #define RGB16PC  8192L
  126. #define BGR16PC  16384L
  127. #define BGRA32   32768L
  128. #define Planar1  1L
  129. #define Planar2  2L
  130. #define Planar3  4L
  131. #define Planar4  8L
  132. #define Planar5  16L
  133. #define Planar6  32L
  134. #define Planar7  64L
  135. #define Planar8  128L
  136. #define Planar1I 1<<16L
  137. #define Planar2I 1<<17L
  138. #define Planar3I 1<<18L
  139. #define Planar4I 1<<19L
  140. #define Planar5I 1<<20L
  141. #define Planar6I 1<<21L
  142. #define Planar7I 1<<22L
  143. #define Planar8I 1<<23L
  144. #define PlanarEHB 1<<15L
  145. #define PlanarEHBI 1<<31L
  146.  
  147. #define rtg_ZBuffer (rtg_Dummy + 0x07)
  148.  
  149. // Allocate a Z-Buffer. Only works with sublibraries that implement the rtgmaster 3D Extensions.
  150.  
  151. #define rtg_Use3D (rtg_Dummy + 0x08)
  152.  
  153. // Use the 3D Chips. (You can only do conventional Double/Triple-Buffering, if you do NOT use
  154. // them. If you use them, the Extra Buffers are used by the 3D Chips)
  155.  
  156. #define rtg_Workbench (rtg_Dummy + 0x09)
  157.  
  158. // Open a Window on the Workbench, instead of a Screen. This Tag takes the Colorformat
  159. // to use with CopyRtgBlit() as Parameter
  160.  
  161. // End of OpenRtgScreenTagList() enumeration ***
  162.  
  163. // This structure is private and for the internal use of RtgMaster.library
  164. // and its sub-libraries ONLY.  This structure will change in the future.
  165.  
  166. #define rtg_MouseMove (rtg_Dummy+ 0x0A)
  167.  
  168. // RtgGetMsg also returns IDCMP_MOUSEMOVE messages
  169.  
  170. #define rtg_DeltaMove (rtg_Dummy+ 0x0B)
  171.  
  172. // RtgGetMsg also returns IDCMP_MOUSEMOVE messages, and it returns Delta-Values,
  173. // not absolute values.
  174.  
  175. #define rtg_PubScreenName (rtg_Dummy+ 0x0C)
  176.  
  177. // Open a Window on a Public Screen with the provided Public Screen Name.
  178. // Note: This does not work with all Sublibraries. Some simply ignore this
  179. // (For example EGS...)
  180.  
  181. #define rtg_ChangeColors (rtg_Dummy+ 0x0D)
  182.  
  183. // If set, in case of a Workbench Window the Colors are REALLY changed. If
  184. // Not set, only ObtainBestPens is done... normally not setting it is the
  185. // best choice. If that gives you not nice looking colors, you might try
  186. // to set it...
  187.  
  188. struct RtgDimensionInfo
  189. {
  190.     ULONG Width;
  191.     ULONG Height;
  192. };
  193.  
  194. // This structure is private and for the internal use of RtgMaster.library
  195. // and its sub-libraries ONLY.  This structure will change in the future.
  196.  
  197. struct ScreenMode
  198. {
  199.     struct MinNode ScrNode;
  200.  
  201.     // ln_Succ and ln_Pred from ListNode structure
  202.  
  203.     STRPTR Name;
  204.     STRPTR Description;
  205.  
  206.     // Description of the graphics board this mode
  207.     // requires.  For example: "Standard Amiga Chipset".
  208.     // Description should not be longer than 31
  209.     // characters including terminating NULL-byte.  This
  210.     // pointer might be zero so watch out.
  211.  
  212.     ULONG GraphicsBoard;
  213.  
  214.     // The graphics board this mode requires
  215.  
  216.     ULONG ModeID;
  217.  
  218.     // ModeID (depends on sm_GraphicsBoard)
  219.  
  220.     BYTE Reserved[8];
  221.  
  222.     // 8 bytes reserved space for use of the sub-library
  223.     // who creates this ScreenMode structure.  This is
  224.     // PRIVATE to the sub-library!
  225.  
  226.     ULONG MinWidth;
  227.  
  228.     // minimum width in pixels
  229.  
  230.     ULONG MaxWidth;
  231.  
  232.     // maximum width in pixels
  233.  
  234.     ULONG MinHeight;
  235.  
  236.     // Minimum height in pixels
  237.  
  238.     ULONG MaxHeight;
  239.  
  240.     // Maximum height in pixels
  241.  
  242.     struct RtgDimensionInfo Default;
  243.  
  244.     // Standard width and height of this ScreenMode
  245.  
  246.     struct RtgDimensionInfo TextOverscan;
  247.  
  248.     // Settable via preferences
  249.  
  250.     struct RtgDimensionInfo StandardOverscan;
  251.  
  252.     // Settable via preferences
  253.  
  254.     struct RtgDimensionInfo MaxOverscan;
  255.  
  256.     // Maximum width and height (without the
  257.     // need for AutoScrolling).  Hardware
  258.     // dependant.
  259.  
  260.     ULONG ChunkySupport;
  261.  
  262.     // This LONG is used to indicate which Chunky
  263.     // modes this ScreenMode supports.  A set bit
  264.     // means the mode is available.  See the
  265.     // rtg_ChunkySupport tag for more information.
  266.     // Note that the same ScreenMode may never
  267.     // use two different layouts (for example BGR
  268.     // and RGB)
  269.  
  270.     ULONG PlanarSupport;
  271.  
  272.     // This LONG is used to indicate which Planar
  273.     // modes this ScreenMode supports.  A set bit
  274.     // means the mode is available.  See the
  275.     // rtg_PlanarSupport tag for more information.
  276.     // Note that the same ScreenMode may never
  277.     // use both interleaved and non-interleaved
  278.     // layouts.
  279.  
  280.     ULONG PixelAspect;
  281.  
  282.     // For a PAL 320x256 screen you have to write
  283.     // this value here:  sm_PixelAspect =
  284.     // (320/4)/(256/3) * 65536
  285.     //
  286.     // This tells the relation between the height and
  287.     // the width of a single pixel on 4:3 screen.  For
  288.     // a 640x480 screen this value is 1*65536.
  289.  
  290.     ULONG VertScan;
  291.  
  292.     // Vertical scan rate of this screenmode
  293.     // (in Hz)
  294.  
  295.     ULONG HorScan;
  296.  
  297.     // Horizontal scan rate of this screenmode
  298.     // (in Hz)
  299.  
  300.     ULONG PixelClock;
  301.  
  302.     // Pixelclock rate (in Hz)
  303.  
  304.     ULONG VertBlank;
  305.  
  306.     // Vertical blank rate of this screenmode
  307.     // (in Hz)  (How often the VBlank interupt
  308.     // is triggered)
  309.  
  310.     ULONG Buffers;
  311.  
  312.     // The number of buffers this ScreenMode can
  313.     // can handle.  This should always be atleast
  314.     // 1, 2 if the Screen can do double-buffering
  315.     // and 3 if it can do triple-buffering.
  316.  
  317.     UWORD BitsRed;
  318.  
  319.     // The number of bits per gun for Red
  320.  
  321.     UWORD BitsGreen;
  322.  
  323.     // The number of bits per gun for Green
  324.  
  325.     UWORD BitsBlue;
  326.  
  327.     // The number of bits per gun for Blue
  328. };
  329.  
  330. // The TagItem ID's (ti_Tag values) for GetRtgScreenData()
  331.  
  332. // These tags are used to return data to the user about the RtgScreen
  333. // structure in a future compatible way.
  334.  
  335. #define grd_Dummy TAG_USER
  336.  
  337. #define grd_Width (grd_Dummy + 0x01)
  338.  
  339. // Gets you the Width in pixels of the screen
  340.  
  341. #define grd_Height (grd_Dummy + 0x02)
  342.  
  343. // Gets you the Height in pixels of the screen
  344.  
  345. #define grd_PixelLayout (grd_Dummy + 0x03)
  346.  
  347. // Gets you the pixellayout of the screen, see
  348. // defines below.  This also tells you whether
  349. // the screen is Chunky or Planar
  350.  
  351. #define grd_ColorSpace (grd_Dummy + 0x04)
  352.  
  353. // Gets you the colorspace of the screen, see
  354. // defines below
  355.  
  356. #define grd_Depth (grd_Dummy + 0x05)
  357.  
  358. // The number of colors LOG 2.  For Planar modes
  359. // this also tells you the number of bitplanes.
  360. // Don't rely on this number except to get the
  361. // number of colors for Chunky modes.
  362.  
  363. #define grd_PlaneSize (grd_Dummy + 0x06)
  364.  
  365. // Tells you the number of bytes to skip to get
  366. // to the next (bit)plane.  You can use this to
  367. // find the start addresses of the other (bit)planes
  368. // in Planar and in (BytePlane) Chunky modes
  369.  
  370. #define grd_BytesPerRow (grd_Dummy + 0x07)
  371.  
  372. // The number of bytes taken up by a row.  This
  373. // refers to one (bit/byte)plane only for modes
  374. // working with planes.
  375.  
  376. #define grd_MouseX (grd_Dummy + 0x08)
  377.  
  378. // Finds out the Mouse X position
  379.  
  380. #define grd_MouseY (grd_Dummy + 0x09)
  381.  
  382. // Finds out the Mouse Y position
  383.  
  384. // The TagItem ID's (ti_Tag values) for GetGfxCardData()
  385.  
  386. // These tags are used to return data to the user about the graphics card
  387. // which the RtgScreen uses.
  388.  
  389. #define grd_BusSystem (grd_Dummy + 0x0A)
  390.  
  391. #define grd_3DChipset (grd_Dummy + 0x0B)
  392.  
  393. // For usage with the rtgmaster 3D Extensions, will be ignored from sublibraries
  394. // that do not support the 3D Extensions.
  395.  
  396. #define grd_Z3 1 // Zorro III Bus
  397. #define grd_Z2 2 // Zorro II Bus
  398. #define grd_Custom 3 // Custom Chipset
  399. #define grd_RGBPort 4 // Board connected to RGB Port
  400. #define grd_GVP 5 // GVP "special" Bus of GVP Turbo Board (EGS110 GFX Board)
  401. #define grd_DDirect 6 // DraCo Direct Bus
  402. #define grd_Ateo 7 // Ateo Bus
  403. #define grd_PCI 8 // PCI
  404.  
  405. // defines for grd_PixelLayout
  406.  
  407. #define grd_PLANAR     0 // Non interleaved planar layout [X bitplanes/pixel]
  408. #define grd_PLANARI    1 // Interleaved planar layout     [X bitplanes/pixel]
  409. #define grd_CHUNKY     2 // 8-bit Chunky layout           [BYTE/pixel]
  410. #define grd_HICOL15    3 // 15-bit Chunky layout          [WORD/pixel]
  411. #define grd_HICOL16    4 // 16-bit Chunky layout          [WORD/pixel]
  412. #define grd_TRUECOL24  5 // 24-bit Chunky layout          [3 BYTES/pixel]
  413. #define grd_TRUECOL24P 6 // 24-bit Chunky layout          [3 BYTEPLANES/pixel]
  414. #define grd_TRUECOL32  7 // 24-bit Chunky layout          [LONG/pixel]
  415. #define grd_GRAFFITI   8 // 8-bit Graffiti-type Chunky layout (very special...)
  416. #define grd_TRUECOL32B 9
  417.  
  418. // defines for grd_ColorSpace
  419.  
  420. #define grd_Palette 0 // Mode uses a Color Look-Up Table (CLUT)
  421. #define grd_RGB     1 // Standard RGB color space
  422. #define grd_BGR     2 // high-endian RGB color space, BGR
  423. #define grd_RGBPC   3 // RGB with lowbyte and highbyte swapped
  424. #define grd_BGRPC   4 // BGR with lowbyte and highbyte swapped
  425.  
  426. // End of GetRtgScreenData() enumeration ***
  427.  
  428.  
  429. // Information about the RtgScreenModeReq tags:
  430. //
  431. // Each tag specified for the RtgScreenModeReq() function limits in some
  432. // way the number of ScreenModes available to the user.  Sometimes this
  433. // means a screenmode is completely ommited, and sometimes this means
  434. // certain screenmodes can only be used if the user selects them to
  435. // be wide enough.  So for example, a ScreenMode which supports screens
  436. // of 300 to 400 pixels in width, could be filtered out completely by
  437. // setting smr_MinWidth to 401.  But if the smr_MinWidth is set to for
  438. // example 320 then the user is allowed to select a width of 320-400
  439. // pixels (for this ScreenMode, and if the smr_MaxWidth allows this).
  440. // If smr_MinWidth is 200 pixels then the ScreenMode is the limiting
  441. // factor which means the user can't select ScreenModes smaller than
  442. // 300 pixels.
  443. //
  444. // The PlanarSupport and ChunkySupport tags determine which ScreenModes
  445. // are available to the user depending on their layout and number of
  446. // colors.
  447. // This structure is private and for the internal use of RtgMaster.library
  448. // and its sub-libraries ONLY.  This structure will change in the future.
  449.  
  450. struct ScreenReq
  451. {
  452.     struct ScreenMode *ScreenMode;
  453.  
  454.     // Ptr to ScreenMode structure
  455.  
  456.     ULONG Width;
  457.  
  458.     // Must be within Tag specified limits
  459.  
  460.     ULONG Height;
  461.  
  462.     // The width and height which the user selected
  463.  
  464.     UWORD Depth;
  465.  
  466.     // Number of colors log2 which the user selected
  467.     UWORD Overscan;
  468.  
  469.     // 0 = No Overscan.  See defines below.
  470.  
  471.     UBYTE Flags; // For the meaning of the bits see below
  472. };
  473.  
  474. struct ScreenReqList
  475. {
  476.  struct MinNode SRNode;
  477.  struct ScreenReq *req;
  478. };
  479.  
  480. // Bits set in ScreenMode.Flags
  481.  
  482. #define sq_EHB          (1 << 0)   // EHB selected (sq_Depth = 6)
  483. #define sq_CHUNKYMODE   (1 << 1)   // Chunky Mode selected
  484. #define sq_DEFAULTX     (1 << 2)   // Default Width selected
  485. #define sq_DEFAULTY     (1 << 3)   // Default Height selected
  486. #define sq_WORKBENCH    (1 << 4)   // User wants to use Workbench Window
  487.  
  488. // defines for Overscan
  489.  
  490. #define sq_NOOVERSCAN       0
  491. #define sq_TEXTOVERSCAN     1 // User settable, should be entirely visible
  492. #define sq_STANDARDOVERSCAN 2 // Standard overscan (just past edges)
  493. #define sq_MAXOVERSCAN      3 // Maximum overscan (as much as possible)
  494.  
  495. // This structure is private and for the internal use of RtgMaster.library
  496. // and its sub-libraries ONLY.  This structure will change in the future.
  497.  
  498. struct RtgScreen
  499. {
  500.     ULONG LibBase;
  501.     UWORD LibVersion;
  502.     UWORD Pad1;
  503.     ULONG GraphicsBoard;
  504.     BYTE  Reserved[20];
  505.     ULONG MouseX;
  506.     ULONG MouseY;
  507.     APTR  c2pcode;
  508.     APTR  c2pdata;
  509.     ULONG c2pcurr;
  510.     BYTE  c2pname[30];
  511. };
  512.  
  513. #endif
  514.  
  515.